// 固定写法
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router);
// 导入组件1和2
import r1 from '../components/r1'
import r2 from '../components/r2'
import r21 from '../components/r21'
import r22 from '../components/r22'
import login from '../components/login'

// 定义路由规则
export default new Router({
    routes: [
        {
            path: '/r1',
            name: 'router1',
            component: r1
        }, {
            path: '/',
            name: 'login',
            component: login,
            meta:{
                requirelogin:true
            }
        },
        {
            path: '/r2',
            name: 'router2',
            component: r2,
            children:[
                {
                    path:'r21',
                    component:r21,
                },
                {
                    path:'r22',
                    component:r22
                }]
        }
    ]
})

